
<template>
  <div>
    {{count}}
    <div>
      <button @click="addCount(1)">+1</button>
      <button @click="minusCount(1)">-1</button>
    </div>
    <div>
      <button @click="addCountAsync(1)">+1 async</button>
      <button @click="minusCountAsync(1)">-1 async</button>
    </div>
  </div>
</template>

<script>
/* eslint-disable */
export default {
  computed: {
    count: function() {
      return this.$store.state.module1.count
    }
  },
  methods: {
    addCount: function(payload) {
      this.$store.commit('module1/addCount', payload);
    },
    minusCount: function(payload) {
      this.$store.commit('module1/minusCount', payload);
    },
    addCountAsync: function(payload) {
      this.$store.dispatch('module1/addCountAsync', payload);
    },
    minusCountAsync: function(payload) {
      this.$store.dispatch('module1/minusCountAsync', payload);
    }
  }
}
</script>

<style>

</style>